
<!DOCTYPE html>
<html lang="zh-Hans">


<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
  <meta name="theme-color" content="#202020"/>
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  
    <meta name="keywords" content="Hexo," />
  

  
    <meta name="description" content="你眼里的星辰大海·是我从未见过的皓月明空" />
  
  
  
  <link rel="icon" type="image/x-icon" href="/images/footer-logo.png">
  
  <title>Hexo基本操作命令 [ 向阳·Tech ]</title>
  
    <!-- stylesheets list from config.yml -->
    
      <link rel="stylesheet" href="/css/pure-min.css">
    
      <link rel="stylesheet" href="/css/xoxo.css">
    
  
<meta name="generator" content="Hexo 4.1.1"></head>


<body>
  <div class="nav-container">
    <nav class="home-menu pure-menu pure-menu-horizontal">
  <a class="pure-menu-heading" href="/">
    
    <span class="title" style="text-transform:none">向阳·Tech</span>
  </a>

  <ul class="pure-menu-list clearfix">
      
          
            
              <li class="pure-menu-item"><a href="/" class="pure-menu-link">首页</a></li>
            
          
      
          
            
              <li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover">
            
              <a href="#" id="post" class="pure-menu-link">文章</a>
              <ul class="pure-menu-children">
              
                  
                    <li class="pure-menu-item"><a href="/categories" style="color:#202020;" class="pure-menu-link">分类</a></li>
                  
              
                  
                    <li class="pure-menu-item"><a href="/archives" style="color:#202020;" class="pure-menu-link">归档</a></li>
                  
              
                  
                    <li class="pure-menu-item"><a href="/tags" style="color:#202020;" class="pure-menu-link">标签</a></li>
                  
              
              </ul>
            </li>
          
      
          
            
              <li class="pure-menu-item"><a href="/live" class="pure-menu-link">撩胜于无聊</a></li>
            
          
      
          
            
              <li class="pure-menu-item"><a href="https://github.com/irtb" target="_blank" rel="noopener" class="pure-menu-link">Github</a></li>
            
          
      
  </ul>
   
</nav>

  </div>

  <div class="container" id="content-outer">
    <div class="inner" id="content-inner">
      <div class="post-container">
  <article class="post" id="post">
    <header class="post-header text-center">
      <h1 class="title">
        Hexo基本操作命令
      </h1>
      <span>
        
        <time class="time" datetime="2019-12-13T21:37:02.000Z">
        2019-12-13
      </time>
        
      </span>
      <span class="slash">/</span>
      <span class="post-meta">
      <span class="post-tags">
        <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Hexo/" rel="tag">Hexo</a></li></ul>
      </span>
    </span>
    </header>

    <div class="post-content">
      <h4 id="安装相关"><a href="#安装相关" class="headerlink" title="安装相关"></a>安装相关</h4><blockquote>
<p>安装Hexo</p>
</blockquote>
<pre>npm install -g hexo-cli</pre>
<blockquote>
<p>卸载Hexo</p>
</blockquote>
<pre>npm uninstall hexo-cli -g</pre>

<h4 id="写作相关"><a href="#写作相关" class="headerlink" title="写作相关"></a>写作相关</h4><blockquote>
<p>新建文章</p>
</blockquote>
<pre>hexo n "名字" == hexo new "名字"</pre>
<blockquote>
<p>新建一个名为”newpage”的页面，默认网址主页地址/newapge/</p>
</blockquote>
<pre>hexo n page newpage</pre>
<blockquote>
<p>生成静态文件</p>
</blockquote>
<pre>hexo g == hexo generate</pre>
<blockquote>
<p>发布文章</p>
</blockquote>
<pre>hexo d == hexo -deploy</pre>
<blockquote>
<p>启动本地服务器，预览地址：<a href="http://localhost:4000/" target="_blank" rel="noopener">http://localhost:4000/</a></p>
</blockquote>
<pre>hexo s == hexo server</pre>
<blockquote>
<p>清理缓存文件和已生成的静态文件</p>
</blockquote>
<pre>hexo clean</pre>

<h4 id="组合使用"><a href="#组合使用" class="headerlink" title="组合使用"></a>组合使用</h4><blockquote>
<p>清理并开启本地预览服务</p>
</blockquote>
<pre>hexo clean && hexo s</pre>
<blockquote>
<p>清理并重新生成静态文件</p>
</blockquote>
<pre>hexo clean && hexo g</pre>
<blockquote>
<p>生成后立即部署网站</p>
</blockquote>
<pre>hexo g -d == hexo generate -d == hexo generate -deploy</pre>

<h4 id="系统命令"><a href="#系统命令" class="headerlink" title="系统命令"></a>系统命令</h4><pre><code>hexo --help

Commands:
  clean     Remove generated files and cache.
  config    Get or set configurations.
  deploy    Deploy your website.
  generate  Generate static files.
  help      Get help on a command.
  init      Create a new Hexo folder. # 初始化博客
  list      List the information of the site
  migrate   Migrate your site from other system to Hexo.
  new       Create a new post.
  publish   Moves a draft post from _drafts to _posts folder.
  render    Render files with renderer plugins.
  server    Start the server.
  version   Display version information.

Global Options:
  --config  Specify config file instead of using _config.yml
  --cwd     Specify the CWD
  --debug   Display all verbose messages in the terminal
  --draft   Display draft posts
  --safe    Disable all plugins and scripts
  --silent  Hide output on console</code></pre>
    </div>

  </article>
  <div class="toc-container">
    
  <div id="toc" class="toc-article">
    <strong class="toc-title">目录</strong>
    <ol class="toc"><li class="toc-item toc-level-4"><a class="toc-link" href="#安装相关"><span class="toc-text">安装相关</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#写作相关"><span class="toc-text">写作相关</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#组合使用"><span class="toc-text">组合使用</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#系统命令"><span class="toc-text">系统命令</span></a></li></ol>
  </div>


  </div>
</div>
<div class="copyright">
    <span>本作品采用</span>
    <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank" rel="noopener">知识共享署名 4.0 国际许可协议</a>
    <span>进行许可。 转载时请注明原文链接。</span>
</div>


  
    <div class="post-nav">
      <div class="post-nav-item post-nav-next">
        
      </div>
  
      <div class="post-nav-item post-nav-prev">
          
          <a href="/2019/12/30/Webservice-WSDL/" rel="prev" title="Webservice WSDL">
            Webservice WSDL
          </a>
          <span>〉</span>
        
      </div>
    </div>
  



    </div>

    

  </div>
  <footer class="footer text-center">
    <div id="bottom-inner">
        <a class="bottom-item" href="https://github.com/irtb" target="_blank">GitHub</a> |
        <a class="bottom-item" href="/links">友情链接</a> |
        <a class="bottom-item" href="https://hexo.io" target="_blank">Powered by hexo</a> |
        <a class="bottom-item" href="https://github.com/fooying/hexo-theme-xoxo-plus" target="_blank">Theme xoxo-plus</a>
        <a href="https://beian.miit.gov.cn/" target="_blank">京ICP备15011709号-1</a>
    </div>
</footer>

  
</body>
</html>
